import java.io.*;
import java.util.*;
import java.net.*;
import java.security.Security;
import java.security.Provider;
import javax.net.ssl.*;

import local.util.MyPrint;

public class UpDownGrade
{
   
    public static void main (String  args[]) {
	String tick = args[0];
	UpDownGrade ud = new UpDownGrade ();
	System.out.println(ud.getUpDownGradeMessage (tick));
    }

    public String getUpDownGradeMessage (String tick) {

	Vector vInput= new Vector(10);
	String url_return_string = null;
	HttpDataLoader dl = new HttpDataLoader();

	dl.setUrl("http://biz.yahoo.com/c/"+tick.charAt(0)+"/"+tick+".html");
	dl.connectToUrl();
	dl.setStartString("Details");
	dl.setEndString("Copyright");
	url_return_string = dl.getUrlReturnString();

	vInput = dl.stringToVector (url_return_string);
	vInput = dl.selectUsefulElements (vInput);
	vInput = dl.deselectElement (vInput, "Details");

	String text = "";
	StringBuffer stbf = new StringBuffer ();
	Enumeration penum = vInput.elements();
	int i = 0;
	while ( penum.hasMoreElements()) {
	    i++;
	    text = (String)penum.nextElement();
	    stbf.append(text+" ");
	    if (i>5) break;
	}

	if((stbf.toString()) != null) {
	    return stbf.toString();
	}
	else {
	    return (" ");
	}
    }
}






